<?php
/**
 * The Sidebar containing the main widget area
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */
?>
<div id="secondary" class="col-left cmszone">
	<?php
		//$description = get_bloginfo( 'description', 'display' );
		if ( ! empty ( $description ) ) :
	?>
	<h2 class="site-description"><?php echo esc_html( $description ); ?></h2>
	<?php endif; ?>

	<?php if (false && has_nav_menu( 'secondary' ) ) : ?>
	<nav role="navigation" class="navigation site-navigation secondary-navigation">
		<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>
	</nav>
	<?php endif; ?>

    <?php if (is_category()): ?>
        <?php
            $cat_id = get_query_var('cat');
            $all_categories = get_categories();
            $cat = getCategoryLevelTwo($all_categories,$cat_id);
        ?>
        <h2 class="title-left"><?php echo $cat->name; ?></h2>
        <ul class="navigation-level2">
            <?php wp_list_categories('title_li=&child_of=' . $cat->cat_ID); ?>
        </ul>
    <?php endif; ?>

	<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
	<div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary">
		<?php dynamic_sidebar( 'sidebar-1' ); ?>
	</div><!-- #primary-sidebar -->
	<?php endif; ?>
</div><!-- #secondary -->
